package com.iteaj.iot.test.udp;

import com.iteaj.iot.message.DefaultMessageHead;
import com.iteaj.iot.server.UdpServerMessage;
import com.iteaj.iot.test.TestProtocolType;

import java.net.InetSocketAddress;

/**
 * create time: 2021/9/12
 *
 * @author iteaj
 * @since 1.0
 */
public class UdpTestMessage extends UdpServerMessage {

    public UdpTestMessage(byte[] message) {
        super(message);
    }

    public UdpTestMessage(MessageHead head, InetSocketAddress recipient) {
        super(head, recipient);
    }

    public UdpTestMessage(MessageHead head, MessageBody body, InetSocketAddress recipient) {
        super(head, body, recipient);
    }

    @Override
    protected MessageHead doBuild(byte[] message) {
        return new DefaultMessageHead(getChannelId(), "", TestProtocolType.Heart);
    }
}
